POV-Ray : Newsgroups : povray.general : normals function : Re: normals function Server Time
3 Aug 2024 16:18:56 EDT (-0400)
  Re: normals function  
From: Warp
Date: 11 Jan 2004 10:56:24
Message: <40017227@news.povray.org>
Stephen McAvoy <mcavoys[at]aolDOTcom> wrote:
> >  (Another useful operator is the dot-product, but that's another story.)

> Well tell it please, your cross-product story was iluminating. 
> Regards

  The result of the dot-product of two vectors is a scalar which is the
product of the lengths of the two vectors multiplied with the cosine of
the angle between them.
  The good thing about the dot-product is that it's very easy to calculate
with multiplications and additions only. The dot-product of <ux, uy, uz>
and <vx, vy, vz> is ux*vx+uy*vy+uz*vz.

  When the two vectors are unit vectors, their dot-product is simply the
cosine of the angle between them (because the product of their lengths
is 1).
  This property is very useful for many things. For example the lighting
at a certain point in a surface is proportional to the cosine of the angle 
between the normal vector and the vector which points towards the light
source. This is very fast to calculate with the dot-product (when the
two vectors have been normalized).

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.